package com.bodu.exchange.client.impl;

import com.bodu.core.entity.ParamReq;
import com.bodu.core.entity.enums.DelFlagEnum;
import com.bodu.core.entity.enums.StatusFlagEnum;
import com.bodu.core.entity.result.Result;
import com.bodu.exchange.client.ExchangeIconClient;
import com.bodu.exchange.entity.request.ExchangeIconRequest;
import com.bodu.exchange.entity.vo.ExchangeIconVo;
import com.bodu.exchange.service.ExchangeIconService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Administrator
 */
@Service
public class ExchangeIconClientImpl implements ExchangeIconClient {
    @Autowired
    private ExchangeIconService exchangeIconService;
    @Override
    public Result<ExchangeIconVo> iconsList() {
        ParamReq<ExchangeIconRequest> params = new ParamReq<>();
        
        ExchangeIconRequest exchangeIconRequest = new ExchangeIconRequest();
        exchangeIconRequest.setDelFlag(DelFlagEnum.NO.getValue());
        exchangeIconRequest.setStatusFlag(StatusFlagEnum.USE.getValue());
        params.setEntity(exchangeIconRequest);
        
        params.setCurrent(1);
        params.setSize(1000);
        
        List<ExchangeIconVo> list =  exchangeIconService.listPage(params);
        return Result.success(list);
    }
}
